package com.maybach.workflow.common.api.enums;

/**
 * Created by well on 15/3/12.
 */
public enum RoleEnum {

    /**
     * 买家
     */
    buyer("买家"),

    /**
     * 服务商
     */
    service("服务商"),
    /**
     * 分销商
     */
    agent("分销商"),
    /**
     * 供应商
     */
    provider("供应商"),
    /**
     * 
     */
    admin("管理员"),

    system("系统"),

    read("普通"),

    custom_service("客服"),
    
    adminLogistics("物流"),
    adminAgent("分销"),
    adminAgentManager("销售经理"),
    adminProvider("供应链"),
    adminProviderManager("供应链经理"),
    adminService("服务"),
    adminFinance("财务"),
    adminSale("直销"),
    adminOperate("运营"),
    adminCoupon("优惠券"),
    adminBanking("金融"),

    //主管领导 金刚
    adminManager("主管领导"),
    //财务主管
    adminFinanceManager("财务主管"),


    /**
     * 分销商
     */
    agentSale("分销商(后台账号)"),
    /**
     * 车易拍
     */
    cheyipai("车易拍(后台账号)"),
    /**
     * p2p金融
     */
    p2pFinance("金融"),

    allOrderSearch("全部订单搜索"),

    orderAdmin("订单管理员"),

    agentAndService("销售"),
    cashier("出纳"),

    ;

    private String role;

    RoleEnum(String role){
        this.role = role;
    }

    public String getRole() {
        return role;
    }

    public static RoleEnum getRole(String roleName){
        for(RoleEnum role : RoleEnum.values()){
            if(role.getRole().equals(roleName)){
                return role;
            }
        }
        return  null;
    }

    public static RoleEnum getRoleByName(String roleName){
        for(RoleEnum role : RoleEnum.values()){
            if(role.name().equals(roleName)){
                return role;
            }
        }
        return  null;
    }

}
